console.log('global start');

setTimeout(() => {
    console.log('timeout');
}, 0);

Promise.resolve()
    .then(() => {
        console.log('promise2')
    })
    .then(() => {
        console.log('promise2')
    });

console.log('global end');